/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       bitmap_cursor.h

	$Header: /game/bitmap_cursor.h $

	$NoKeywords: $

 ************************************************************************/
// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "bitmap_cursor.h"

#include "bitmap_group.h"
#include "bitmap_group_window.h"
#include "mouse_window.h"
// ------------------------------------------------------------------------
// movement cursor with variants for different distances
// ------------------------------------------------------------------------
void t_bitmap_cursor::create( t_bitmap_group_ptr const& bitmaps )
{
	cursor = new t_mouse_window;
	cursor->set_visible( false );
	frames = new t_bitmap_group_window( bitmaps, t_screen_point(0,0), 0, cursor );

	t_bitmap_layer const* hot_spot = bitmaps->find( "hot_spot" );

	if ( hot_spot != 0 )
		cursor->set_hot_spot( hot_spot->get_rect().top_left() );
}

// ------------------------------------------------------------------------
// movement cursor with variants for different distances
// ------------------------------------------------------------------------
void t_bitmap_cursor::set_frame( std::string const& name )
{
	t_bitmap_layer const* hot_spot;

	frames->set_frame( name );
	hot_spot = frames->get_bitmaps()->find( name + "_hot_spot" );
	if (hot_spot != 0)
		cursor->set_hot_spot( hot_spot->get_rect().top_left() );
}
